import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import { AlainThemeModule } from '@delon/theme';
// i18n
import { TranslateModule } from '@ngx-translate/core';

// #region third libs
import { CountdownModule } from 'ngx-countdown';
import { NgxTinymceModule } from 'ngx-tinymce';
import { itcoreModule } from './itcore/itcore.module';

import { AdSearchComponent } from './components/ad-search/ad-search.component';
import { AdSearchModalComponent } from './components/ad-search/modal/modal.component';
import { FilterGroupComponent } from './components/filter-group/filter-group.component';
import { FilterRuleComponent } from './components/filter-group/filter-rule.component';
import { FunctionViewComponent } from './components/function-view/function-view.component';
import { ModalTreeComponent } from './components/modal-tree/modal-tree.component';
import { ItcoreConnectionComponent } from './itcore/components/common/db/connection.component';
import { ItcoreDbColumnFilterComponent } from './itcore/components/common/db/db-column-filter.component';
import { ItcoreImportComponent } from './itcore/components/common/Import/import.component';
import { ItcorePlanloglistComponent } from './itcore/components/common/planjob/planloglist.component';

import { SHARED_DELON_MODULES } from './shared-delon.module';
import { SHARED_ZORRO_MODULES } from './shared-zorro.module';

const THIRDMODULES = [
  CountdownModule,
  itcoreModule,
  NgxTinymceModule.forRoot({
    baseURL: '//cdn.bootcss.com/tinymce/4.7.13/',
  }),
];
// #endregion

// #region your componets & directives
const COMPONENTS = [
  ModalTreeComponent,
  FilterGroupComponent,
  FilterRuleComponent,
  AdSearchComponent,
  AdSearchModalComponent,
  FunctionViewComponent,
  ItcoreImportComponent,
  ItcoreConnectionComponent,
  ItcoreDbColumnFilterComponent,
  ItcorePlanloglistComponent,
];
const DIRECTIVES = [];
// #endregion

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    ReactiveFormsModule,
    AlainThemeModule.forChild(),
    // third libs
    ...THIRDMODULES,
    ...SHARED_DELON_MODULES,
    ...SHARED_ZORRO_MODULES,
  ],
  declarations: [
    // your components
    ...COMPONENTS,
    ...DIRECTIVES,
  ],
  exports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,
    AlainThemeModule,
    // i18n
    TranslateModule,
    // third libs
    ...THIRDMODULES,
    // your components
    ...COMPONENTS,
    ...DIRECTIVES,
    ...SHARED_DELON_MODULES,
    ...SHARED_ZORRO_MODULES,
  ],
})
export class SharedModule {}
